package kr.co.goodwilldd.entity.menus.model;

import java.io.Serializable;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlElementRefs;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;

@XmlRootElement(name = "menu")
@XmlType(name = "Menu", namespace = "kr.co.goodwilldd.entity.menus.model.MenuEntity")
@JsonAutoDetect
@JsonSerialize(include = Inclusion.NON_DEFAULT)
public class MenuEntity implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5743160335228619212L;
	String title;
	MenuItemEntity metadata;
	List<MenuEntity> children;

	public String getTitle() {
		return title;
	}

	public MenuItemEntity getMetadata() {
		return metadata;
	}

	public List<MenuEntity> getChildren() {
		return children;
	}

	@XmlElement(name="title")
	public void setTitle(String title) {
		this.title = title;
	}

	@XmlElement(name="metadata")
	public void setMetadata(MenuItemEntity metadata) {
		this.metadata = metadata;
	}
	
	@XmlElementWrapper(name="childrens")
	@XmlElementRefs({
		@XmlElementRef(name="children", type=MenuItemEntity.class)
	})
	public void setChildren(List<MenuEntity> children) {
		this.children = children;
	}

}
